#pragma once
#include <boost/signals2.hpp>
#include <nice2d/widgets/control.h>

class AbstractSlider : public Control
{
    DECLARE_OBJECT(AbstractSlider)
public:
    AbstractSlider();
    virtual ~AbstractSlider();
public:
    void setRange(int32_t low, int32_t hight);
    int32_t getLow()const;
    int32_t getHigh()const;

    void setValue(int32_t value);
    int32_t getValue()const;
    boost::signals2::signal<void(int32_t)> valueChanged;

    void setStep(int32_t value = 1);
    int32_t getStep()const;

    float getValuePercent()const;
protected:
    virtual void onValueChanged();
private:
    std::unique_ptr<class AbstractSliderData> data;
};
